#pragma once

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stddef.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>

#define SIZE 1024
#define NONE_FLUSH 1
#define LINE_FLUSH (1<<1)
#define FULL_FLUSH (1<<2)
typedef struct my_FILE
{
	/*缓冲区*/
	char _buffer[SIZE];
	/*文件描述符*/
	int _fileNo;
	/*文件内容当前位置*/
	int _pos;
	/*文件容量*/
	int _cap;
	/*刷新机制*/
	int _flush;
}my_FILE;

my_FILE* my_fopen(const char* filename,const char* mode);
void my_close(my_FILE* pf);
int my_fwrite(const char* s,size_t size,size_t n,my_FILE* pf);

void my_fflush(my_FILE* pf);
void DebugPrint(my_FILE* pf);


